﻿// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "MyActor.generated.h"

UCLASS()
class PLUGIN05_API AMyActor : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	AMyActor();

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:	
	// Called every frame
	virtual void Tick(float DeltaTime) override;

	UFUNCTION(BlueprintNativeEvent, BlueprintCallable)
    void DecreaseHealth(int value);

	UFUNCTION(BlueprintCallable)
    void AppendToSpecialName(const FString &Suffix);

	// c++不（不能）提供实现，蓝图中提供实现
    UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
    void OnSpecialNameChanged(const FString &NewName);

	// c++可以（必须）提供实现，蓝图中可以重写
    UFUNCTION(BlueprintNativeEvent, BlueprintCallable)
    void OnSpecialNameChangedNative(const FString &NewName);

public:
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "MyActor")
	FString SpecialName;

protected:
    UPROPERTY(EditAnywhere, BlueprintReadWrite)
	int Health {0};

};
